<template>
  <div class="tableHeader">
    <div class="tableHeader-general">
      <span class="tableHeader-general-title">本月平台使用情况概览</span>
      <span class="tableHeader-general-time">{{
        `${year}年${month}月${day}日`
      }}</span>
    </div>
    <div class="tableHeader-detail">
      <span class="tableHeader-detail-title">专题库使用人次</span>
      <span class="tableHeader-detail-num">{{ databaseNum }}</span>
    </div>
    <div class="tableHeader-detail">
      <span class="tableHeader-detail-title">在线业务申请人次</span>
      <span class="tableHeader-detail-num">{{ allAccumulaNum }}</span>
    </div>
    <div class="tableHeader-detail">
      <span class="tableHeader-detail-title">平台累计使用人次</span>
      <span class="tableHeader-detail-num">{{ platNum }}</span>
    </div>
  </div>
</template>

<script>
import { getNumberUser } from '@/api/oprationStatistics'
export default {
  props: {
    allAccumulaNum: Number,
    databaseNum: Number
  },
  data() {
    return {
      year: '',
      month: '',
      day: '',
      platNum: 0
    }
  },
  mounted() {
    var date = new Date();
    this.year = date.getFullYear(); //获取完整的年份(4位)
    this.month = date.getMonth() + 1; //获取当前月份(0-11,0代表1月)
    this.day = date.getDate(); //获取当前日(1-31)
    this.initData()
  },
  methods: {
    async initData() {
      const { data } = await getNumberUser()
      this.platNum = data
    }
  },
}
</script>